import request from '@/utils/request'

// 查询检测标准列表(待选)
export function listLabMethod(query) {
  return request({
    url: '/lims/labMethod/list',
    method: 'get',
    params: query
  })
}

// 查询检测标准列表(已选)
export function listLabMethod1(query) {
  return request({
    url: '/lims/labMethod/myList',
    method: 'get',
    params: query
  })
}

// 查询仪器使用时间段(已选)
export function getMsg(query) {
  return request({
    url: '/lims/labInstrumentUse/verfyUseTime',
    method: 'get',
    params: query
  })
}

// 查询公式列表
export function listFormula(query) {
  return request({
    url: '/lims/template/table/formula/formulaList',
    method: 'get',
    params: query
  })
}

// 查询选择质控树形结构
export function getXzzkTree(query) {
  return request({
    url: '/lims/labMethod/jcxmTree',
    method: 'get',
    params: query
  })
}

// 查询选择质控树形结构
export function checkTreeNodes(data) {
  return request({
    url: '/lims/labMethod',
    method: 'post',
    data: data
  })
}

// 替代物保存
export function addTdw(data) {
  return request({
    url: '/lims/labMethod/addTdw',
    method: 'post',
    data: data
  })
}

// 查询选择质控树形结构
export function getSelectedList(query) {
  return request({
    url: '/lims/labMethod/sampleJcxmList',
    method: 'get',
    params: query
  })
}

// 查询右上角信息
export function getSelectView(lMId) {
  return request({
    url: '/lims/labMethod/' + lMId,
    method: 'get',
  })
}

// 查询变更方法信息
export function changeMethod(lMId) {
  return request({
    url: '/lims/labMethod/updateMethodList/' + lMId,
    method: 'get',
  })
}

// 查询选择质控树形结构
export function delSelectedList(data) {
  return request({
    url: '/lims/labMethod/delete/removeSample',
    method: 'delete',
    data: data
  })
}

// 查询替代物
export function getSubstitutes(sFId) {
  return request({
    url: '/lims/labMethod/tdw/' + sFId,
    method: 'get',
  })
}

// 更改方法点击确定
export function saveMethod(data) {
  return request({
    url: '/lims/labMethod/updateMethod',
    method: 'post',
    data: data
  })
}
export function addPxy(data) {
  return request({
    url: '/lims/labMethod/addPxy',
    method: 'post',
    data: data
  })
}

// 点击编号平行、加标
export function addSamePxy(data) {
  return request({
      url: '/lims/labMethod/addSampleCodePxyOrJb',
      method: 'post',
      data: data
  })
}

// 点击平行
export function getNumberForm(lMId) {
  return request({
    url: '/lims/labMethod/count/' + lMId,
    method: 'get',
  })
}

// 点击+
export function addNumber(data) {
  return request({
    url: '/lims/labMethod/addKb',
    method: 'post',
    data: data
  })
}

//     myId.value = res.data xzzk保存
// 点击+
export function saveXzzk(lMId) {
  return request({
    url: '/lims/labMethod/labTask/' + lMId,
    method: 'post',
  })
}

// 有myId获取标签页的数量和名称
export function myTaskFormList(myId) {
  return request({
    url: '/lims/myTask/myTaskFormList/' + myId,
    method: 'get',
  })
}

export function listQuality(query) {
  return request({
    url: '/lims/project/qc/getQcList',
    method: 'get',
    params: query
  })
}

export function listQualityJcxm(bzwzId) {
  return request({
    url: '/lims/project/qc/qcJcxmList/' + bzwzId,
    method: 'get',
  })
}

export function listJclb(lMId) {
  return request({
    url: '/lims/project/qc/jclbList/lm/' + lMId,
    method: 'get',
  })
}

export function getProjectList(query) {
  return request({
    url: '/lims/labTask/projectList',
    method: 'get',
    params: query
  })
}

export function labTask(data) {
  return request({
    url: '/lims/labTask',
    method: 'post',
    data: data
  })
}

// 提交审核
export function submitReview(data) {
  return request({
    url: '/lims/labMethod/submit',
    method: 'post',
    data: data
  })
}

// 获取前处理列表
export function listHandle(lMId) {
  return request({
    url: '/lims/labMethod/handleList/' + lMId,
    method: 'get',
  })
}

// 获取样品检出限
export function listChecklimit(query) {
  return request({
    url: '/lims/labMethod/checklimitList',
    method: 'get',
    params: query
  })
}

//   附件列表
export function listAnnex(query) {
  return request({
    url: '/system/file',
    method: 'get',
    params: query
  })
}

// 回显附件
export function formAnnex(fileId) {
  return request({
    url: '/system/file/detail/' + fileId,
    method: 'get',
  })
}

// 删除附件
export function delAnnex(fileId) {
  return request({
    url: '/system/file/delete/' + fileId,
    method: 'delete',
  })
}

// 附件保存
export function saveAnnex(data) {
  return request({
    url: '/system/file/saveFile',
    method: 'post',
    data: data
  })
}

// 查询使用记录列表
// getRecordList
export function getRecordList(query) {
  return request({
    url: '/lims/labInstrumentUse/list',
    method: 'get',
    params: query
  })
}

// 查询仪器下拉列表
export function getInstrumentList(query) {
  return request({
    url: '/lims/labInstrumentUse/instrumentList',
    method: 'get',
    params: query
  })
}

// 保存使用记录
export function labInstrumentUsePost(data) {
  return request({
    url: '/lims/labInstrumentUse',
    method: 'post',
    data: data
  })
}

// 回显form
export function getLabInstrumentUseForm(useId) {
  return request({
    url: '/lims/labInstrumentUse/' + useId,
    method: 'get',
  })
}

// 删除使用记录
export function delRecordAxios(useId) {
  return request({
    url: '/lims/labInstrumentUse/delete/' + useId,
    method: 'delete',
  })
}

// 标准曲线列表接口
export function lineList(query) {
  return request({
    url: '/lims/labLine/list',
    method: 'get',
    params: query
  })
}

// 选择标样接口
export function getBzwzList(query) {
  return request({
    url: '/resource/bzwz/getList',
    method: 'get',
    params: query
  })
}

// 生成标曲表
export function saveSc(data) {
  return request({
    url: '/lims/labLine',
    method: 'post',
    data: data
  })
}

// 标曲表详细信息
export function getLineInfo(lineId) {
  return request({
    url: '/lims/labLine/' + lineId,
    method: 'get'
  })
}

// 保存选择的标曲表
export function addSelectLines(lMId, lineIds) {
  return request({
    url: '/lims/labLine/addSelectLine/' + lMId + '/' + lineIds,
    method: 'post'
  })
}

// 删除标曲表
export function deleteLine(tFId) {
  return request({
    url: '/lims/labLine/delete/' + tFId,
    method: 'delete'
  })
}

export function sampleListCount(lMId){
  return request({
    url: '/lims/labMethod/sampleListCount/' + lMId,
    method: 'get'
  })
}

// 标准曲线表回显
export function editStandard(lineId){
  return request({
    url: '/lims/labLine/' + lineId,
    method: 'get'
  })
}

export function queryDataRel(tFId){
  return request({
    url: '/lims/labMethod/dataRel/' + tFId,
    method: 'get'
  })
}

// 获取禁用时间
export function getDateList(query) {
  return request({
    url: '/lims/labInstrumentUse/useRecord',
    method: 'get',
    params: query
  })
}

// 保存复选框  data
export function isShowSave(data) {
  return request({
    url: '/lims/labInstrumentUse/updateShow',
    method: 'post',
    data: data
  })
}

export function queryQcList(methodId) {
  return request({
    url: '/lims/labMethod/methodQcList/' + methodId,
    method: 'get',
  })
}

// 获取仪器包列表
export function getPackageList(tFId) {
  return request({
    url: '/lims/labMethod/packageList/' + tFId,
    method: 'get',
  })
}

// 保存前处理
export function handleSave(data) {
  return request({
    url: '/lims/labMethod/updateHandle',
    method: 'post',
    data: data
  })
}

// 回显前处理
export function handleMcView(query) {
  return request({
    url: '/lims/labMethod/showHandle',
    method: 'get',
    params: query
  })
}

// 复制上次
export function pasteData(lMId) {
  return request({
    url: '/lims/labMethod/pasteData/' + lMId,
    method: 'get',
  })
}

// 修改检出限
export function getLimtList(lMId) {
  return request({
    url: '/lims/labMethod/setChecklimitList/' + lMId,
    method: 'get',
  })
}

// 保存修改检出限
export function editLimitSave(data) {
  return request({
    url: '/lims/labMethod/setChecklimit',
    method: 'post',
    data: data
  })
}

export function queryJzComponentList(lMId) {
  return request({
    url: '/lims/labMethod/jzComponentList/' + lMId,
    method: 'get'
  })
}

export function saveJzComponent(data) {
  return request({
    url: '/lims/labMethod/saveJzComponent',
    method: 'post',
    data: data
  })
}

